export const getPackagesById = () => [
  {
    package: 'moment',
    version: '2.24.0',
    urls: ['https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js'],
    library: 'moment',
    renderUrls: '',
  },
  {
    package: 'lodash',
    library: '_',
    urls: ['https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js'],
  },
  {
    package: 'iconfont-icons',
    urls: '//at.alicdn.com/t/font_2369445_ukrtsovd92r.js',
  },
  {
    package: '@ant-design/icons',
    version: '4.7.0',
    urls: [
      '//g.alicdn.com/code/npm/@ali/ant-design-icons-cdn/4.5.0/index.umd.min.js',
    ],
    library: 'icons',
  },
  {
    package: 'antd',
    version: '4.23.0',
    urls: [
      '//g.alicdn.com/code/lib/antd/4.23.0/antd.min.js',
      '//g.alicdn.com/code/lib/antd/4.23.0/antd.min.css',
    ],
    library: 'antd',
  },
  {
    title: 'fusion组件库',
    package: '@alifd/next',
    version: '1.23.0',
    urls: [
      'https://g.alicdn.com/code/lib/alifd__next/1.23.18/next.min.css',
      'https://g.alicdn.com/code/lib/alifd__next/1.23.18/next-with-locales.min.js',
    ],
    library: 'Next',
  },
  {
    package: '@alilc/antd-lowcode-materials',
    version: '1.1.0',
    library: 'AntdLowcode',
    urls: [
      'https://alifd.alicdn.com/npm/@alilc/antd-lowcode-materials@1.1.0/build/lowcode/view.js',
      'https://alifd.alicdn.com/npm/@alilc/antd-lowcode-materials@1.1.0/build/lowcode/view.css',
    ],
    editUrls: [
      'https://alifd.alicdn.com/npm/@alilc/antd-lowcode-materials@1.1.0/build/lowcode/view.js',
      'https://alifd.alicdn.com/npm/@alilc/antd-lowcode-materials@1.1.0/build/lowcode/view.css',
    ],
  },
]

export const getProjectSchemaById = () => ({
  version: '1.0.0',
  componentsMap: [
    { devMode: 'lowCode', componentName: 'Page' },
    {
      package: '@alilc/antd-lowcode-materials',
      version: '1.1.0',
      exportName: 'PageHeader',
      main: '',
      destructuring: true,
      componentName: 'PageHeader',
    },
    {
      package: '@alilc/antd-lowcode-materials',
      version: '1.1.0',
      exportName: 'Tabs',
      main: '',
      destructuring: true,
      subName: 'TabPane',
      componentName: 'Tabs.TabPane',
    },
    {
      package: '@alilc/antd-lowcode-materials',
      version: '1.1.0',
      exportName: 'Tabs',
      main: '',
      destructuring: true,
      componentName: 'Tabs',
    },
    {
      package: '@alilc/antd-lowcode-materials',
      version: '1.1.0',
      exportName: 'Table',
      main: '',
      destructuring: true,
      componentName: 'Table',
    },
  ],
  componentsTree: [
    {
      componentName: 'Page',
      id: 'node_dockcviv8fo1',
      props: { ref: 'outerView', style: { height: '100%' } },
      fileName: '/',
      dataSource: {
        list: [
          {
            type: 'fetch',
            isInit: true,
            options: {
              params: {},
              method: 'GET',
              isCors: true,
              timeout: 5000,
              headers: {},
              uri: 'mock/info.json',
            },
            id: 'info',
            shouldFetch: {
              type: 'JSFunction',
              value:
                "function() { \n  console.log('should fetch.....');\n  return true; \n}",
            },
          },
        ],
      },
      state: {
        text: { type: 'JSExpression', value: '"outer"' },
        isShowDialog: { type: 'JSExpression', value: 'false' },
      },
      css: 'body {\n  font-size: 12px;\n}\n\n.button {\n  width: 100px;\n  color: #ff00ff\n}',
      lifeCycles: {
        componentDidMount: {
          type: 'JSFunction',
          value:
            "function componentDidMount() {\n  console.log('did mount');\n}",
        },
        componentWillUnmount: {
          type: 'JSFunction',
          value:
            "function componentWillUnmount() {\n  console.log('will unmount');\n}",
        },
      },
      methods: {
        testFunc: {
          type: 'JSFunction',
          value: "function testFunc() {\n  console.log('test func');\n}",
        },
        onClick: {
          type: 'JSFunction',
          value:
            'function onClick() {\n  this.setState({\n    isShowDialog: true\n  });\n}',
        },
        closeDialog: {
          type: 'JSFunction',
          value:
            'function closeDialog() {\n  this.setState({\n    isShowDialog: false\n  });\n}',
        },
        shouldUpdateFn: {
          type: 'JSFunction',
          value:
            'function shouldUpdateFn(compares) {\n  const [[preName, curName]] = compares;\n  return preName || curName;\n}',
        },
        hiddenFn: {
          type: 'JSFunction',
          value: 'function hiddenFn([name]) {\n  return !!name;\n}',
        },
      },
      originCode:
        'class LowcodeComponent extends Component {\n  state = {\n    "text": "outer",\n    "isShowDialog": false\n  }\n  componentDidMount() {\n    console.log(\'did mount\');\n  }\n  componentWillUnmount() {\n    console.log(\'will unmount\');\n  }\n  testFunc() {\n    console.log(\'test func\');\n  }\n  onClick() {\n    this.setState({\n      isShowDialog: true\n    })\n  }\n  closeDialog() {\n    this.setState({\n      isShowDialog: false\n    })\n  }\n\n\tshouldUpdateFn(compares){\n    const [[preName, curName]] = compares\n    return preName || curName\n\t}\n\n\thiddenFn([name]){\n    return !!name\n\t}\n}',
      hidden: false,
      title: '',
      isLocked: false,
      condition: true,
      conditionGroup: '',
      children: [
        {
          componentName: 'PageHeader',
          id: 'node_ocl95awoun7',
          props: {
            title: 'Title',
            subTitle: 'This is a subtitle',
            ghost: false,
          },
          hidden: false,
          title: '',
          isLocked: false,
          condition: true,
          conditionGroup: '',
        },
        {
          componentName: 'Tabs',
          id: 'node_ocl95awoun8',
          props: {
            type: 'line',
            tabs: [
              { key: 'tab-item-1', tab: '标签项1' },
              { key: 'tab-item-2', tab: '标签项2' },
            ],
            size: 'large',
            centered: false,
            tabPosition: 'top',
            keyboard: false,
          },
          hidden: false,
          title: '',
          isLocked: false,
          condition: true,
          conditionGroup: '',
          children: [
            {
              componentName: 'Tabs.TabPane',
              id: 'node_ocl95awoun9',
              props: { tab: '标签项1', key: 'tab-item-1' },
              hidden: false,
              title: '',
              isLocked: false,
              condition: true,
              conditionGroup: '',
            },
            {
              componentName: 'Tabs.TabPane',
              id: 'node_ocl95awouna',
              props: { tab: '标签项2', key: 'tab-item-2' },
              hidden: false,
              title: '',
              isLocked: false,
              condition: true,
              conditionGroup: '',
            },
          ],
        },
        {
          componentName: 'Table',
          id: 'node_ocl95awounb',
          props: {
            dataSource: [
              {
                id: '1',
                name: '胡彦斌',
                age: 32,
                address: '西湖区湖底公园1号',
              },
              {
                id: '2',
                name: '王一博',
                age: 28,
                address: '滨江区网商路699号',
              },
            ],
            columns: [
              { title: '姓名', dataIndex: 'name', key: 'name' },
              { title: '年龄', dataIndex: 'age', key: 'age' },
            ],
            rowKey: 'id',
            pagination: {
              pageSize: 10,
              total: 15,
              current: 1,
              showSizeChanger: false,
              showQuickJumper: false,
              simple: false,
              size: 'default',
            },
            loading: false,
            showHeader: true,
            size: 'default',
            tableLayout: '',
            scroll: { scrollToFirstRowOnChange: true },
            rowSelection: false,
          },
          hidden: false,
          title: '',
          isLocked: false,
          condition: true,
          conditionGroup: '',
        },
      ],
    },
  ],
  i18n: {},
})
